UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+p7E6Elc1oBSkMKiwUkLPD5ifLXX/LrHCrn0o1xKWzA=' 
WHERE 
  key_id = 'cb02f39d4a9f51d60a5fbb3719e3081c72d2622331c32d2206bd38b0df9da4e3' 
  AND (
    token = '+p7E6Elc1oBSkMKiwUkLPD5ifLXX/LrHCrn0o1xKWzA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018