UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Tkg0jPv25SwvEunCfjeioLmdn7RTCxyDEwxAxUqGdC8=' 
WHERE 
  key_id = '7430f498a3dbfa291577de79c57ec026ba9e284e0b4c92e3eea4d3a3e6dfe2a0' 
  AND (
    token = 'Tkg0jPv25SwvEunCfjeioLmdn7RTCxyDEwxAxUqGdC8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029