UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ajII0rV+PZtHzuZjjn5ZvkNY/BT7bjF8assVa4Hg+Mg=' 
WHERE 
  key_id = '7c2d920846d0ecae208e3ec04e63a641c270a8e8791fb5701654c9a756455ae8' 
  AND (
    token = 'ajII0rV+PZtHzuZjjn5ZvkNY/BT7bjF8assVa4Hg+Mg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028