UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DPwtrzuwWOJWdoBDo3X4vDkmqnGLqTidyOwo7edlT5s=' 
WHERE 
  key_id = '9621ca352c2bc5c3f5e95b93c2b5f96319d5fdcaf42d05774f47993f3b395d74' 
  AND (
    token = 'DPwtrzuwWOJWdoBDo3X4vDkmqnGLqTidyOwo7edlT5s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038