UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'yMUozs9iV+66jnmQbEZKSnyVJOZ1bljFX/i7UzbLHeI=' 
WHERE 
  key_id = '7bd1b99580297c2e8b972d63af730fb344c7694b4e76bf815a5418f7938a5b45' 
  AND (
    token = 'yMUozs9iV+66jnmQbEZKSnyVJOZ1bljFX/i7UzbLHeI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017