UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '12ZrCAKgk3lLwObERazjH3L0X/cJCAxL2YVEpo547sg=' 
WHERE 
  key_id = '13cdd7743c855f3d79d336a47c8482171fbce57dd0d220f9e6c69b3b6911792e' 
  AND (
    token = '12ZrCAKgk3lLwObERazjH3L0X/cJCAxL2YVEpo547sg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024