UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XhRS0++sNv3XzM3OKKR9GqMC5VIGEpo4lwWwc4U61lw=' 
WHERE 
  key_id = '97cc3c2b900a96f672b579b0f664f7254ae312ebd519f2ada6926490972da2fd' 
  AND (
    token = 'XhRS0++sNv3XzM3OKKR9GqMC5VIGEpo4lwWwc4U61lw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027