UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ljpgQmllbAg6/1aU3rwzQ+VCFmGzyxGnWnlx8XqT+/A='
WHERE
key_id = '5d6500f31d069157c02754e5f0e948c1ab559793e5a9232df187804699b36c0c'
AND (
token = 'ljpgQmllbAg6/1aU3rwzQ+VCFmGzyxGnWnlx8XqT+/A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)