UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nKmWR+F32DmkZhK6Bspj25/dWJn45qlY1UkVI2OHPt0=' 
WHERE 
  key_id = 'dcc3b5ed1780d146bdb395080bb6e84df74b1c3457b6a8fe0c10812c4135fe57' 
  AND (
    token = 'nKmWR+F32DmkZhK6Bspj25/dWJn45qlY1UkVI2OHPt0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025