UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mblxbXOyn3cwzmjHJTC1Hgbl5hCoEV6YMbyx55vCkgw=' 
WHERE 
  key_id = '0b1f87de1669e053ea342d5502c9b48669d4b7764ca315ae93ea202d57060d9e' 
  AND (
    token = 'mblxbXOyn3cwzmjHJTC1Hgbl5hCoEV6YMbyx55vCkgw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024