UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'siH67BfTYxq7EIzRr7790aNtxEfg0g1V2GkzEQJ1nbY=' 
WHERE 
  key_id = '804a4f9c6b0718f8a2316788e1ddd6d7dfcbf400e1c05d281bd3c6ea67d1b5bb' 
  AND (
    token = 'siH67BfTYxq7EIzRr7790aNtxEfg0g1V2GkzEQJ1nbY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040