UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'TFP/iuIvTuimPQsVpgxD8ohcuKOi4rwrf4S0hJTdjao=' 
WHERE 
  key_id = '0ca7ca05fa3dd0d4d548e62ffcf34ece49413b2171995f76bd24676cd68f7add' 
  AND (
    token = 'TFP/iuIvTuimPQsVpgxD8ohcuKOi4rwrf4S0hJTdjao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00013