UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HsJ99Otg1CsDlv56zVFgVgVO4aITCKJJMuJ3KcN4PdU=' 
WHERE 
  key_id = '903db073cc14079931690e11873feb5deaee097f857441ca0f52bac9455711bc' 
  AND (
    token = 'HsJ99Otg1CsDlv56zVFgVgVO4aITCKJJMuJ3KcN4PdU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025