UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3U3jYB1z3llndCgea736ju12X57JZLHwi8DQF1O0cbA=' 
WHERE 
  key_id = '187359639190fdd569a3bab3751b5399a90faeeb3a1a22e9fe9d87d41e296132' 
  AND (
    token = '3U3jYB1z3llndCgea736ju12X57JZLHwi8DQF1O0cbA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056