UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tja1/Uc0eEbF+tL+y4Z/mD2V0T7TapsCZZaeEGsVAoU=' 
WHERE 
  key_id = 'e2c5741c6321d6ddfa1c26a351ee51c45a65819b3d1afce7cb329c6994eca3a4' 
  AND (
    token = 'tja1/Uc0eEbF+tL+y4Z/mD2V0T7TapsCZZaeEGsVAoU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037