UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ftUkY282s2dqJTr+PmV6l9F5Ebh4SA4CSI/UDD/EqbY=' 
WHERE 
  key_id = '4276a19d47011c231434f1c68551d3626da31df7ac2e3dd6e6b3a36cbb7ac1d3' 
  AND (
    token = 'ftUkY282s2dqJTr+PmV6l9F5Ebh4SA4CSI/UDD/EqbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050