UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '01SVr0pxiKPHVC5VoIUc2ZN/OVhL7/wfYQovYIM4yJg='
WHERE
key_id = 'df05bc2550cb05c7f86bdb7749b23e347f614c908fb2e0b4b5016eb1e1622c5a'
AND (
token = '01SVr0pxiKPHVC5VoIUc2ZN/OVhL7/wfYQovYIM4yJg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)