UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HnF+T1Q3mkOX5niszJQmo8zYKX6u7vKssn5EhE+eaks='
WHERE
key_id = 'd8b0eb580d9fd22b2573ae6e83f9c618455399dab6a98ae56c5f31cfdbfd59a3'
AND (
token = 'HnF+T1Q3mkOX5niszJQmo8zYKX6u7vKssn5EhE+eaks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)