UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RASuLHghvgHr+6YPtH31j10cglogq1uKpiyTUsvYcmc='
WHERE
key_id = '323462fbabba290b757e9c28c648365eb57eca82dc41c6141f3cc39b1f204b55'
AND (
token = 'RASuLHghvgHr+6YPtH31j10cglogq1uKpiyTUsvYcmc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)