UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PBRM95Z06jTM7K++SysWbkyAnPlx0cBO8v3Pae8pLXY=' 
WHERE 
  key_id = 'f63eb999e7c4650459b3094cd371d696ec31e8803809dc2b7593f4a238bfe851' 
  AND (
    token = 'PBRM95Z06jTM7K++SysWbkyAnPlx0cBO8v3Pae8pLXY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00124