UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'h3x7AplH2G9Xvjm5eiSBGjyrW9f03HMb508/LEVDwNs='
WHERE
key_id = '377e7b25cadf40a4e3b6863b8adc7825830535cf8bb9bf85cd03b642c6e953c2'
AND (
token = 'h3x7AplH2G9Xvjm5eiSBGjyrW9f03HMb508/LEVDwNs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)