UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iRMW/l55C+eonik3Q+K+nnCC486hIWXbGgKAXcFlqi0=' 
WHERE 
  key_id = '488eb6e537daec5252774f50b77cff53a8a85164287e4c3e34e75fdc1d7b9a28' 
  AND (
    token = 'iRMW/l55C+eonik3Q+K+nnCC486hIWXbGgKAXcFlqi0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023