UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Uz5Lhu0Brm/iN6bQKQw07frqwQ/tzFIHfMqzST4vcYE='
WHERE
key_id = 'def32171260d6db1f326f909dd186dabad9407b9055d944a0911e56a52fd68e2'
AND (
token = 'Uz5Lhu0Brm/iN6bQKQw07frqwQ/tzFIHfMqzST4vcYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)