UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9Fw2aDbx1AOnrqiFnbqrQ+kMcZVSdfV2sR+X3cEF/0o='
WHERE
key_id = 'b3b6f8b3595ce3218210a310e74d10c8cda85f0d31b613a0ec8ad86d2fed244e'
AND (
token = '9Fw2aDbx1AOnrqiFnbqrQ+kMcZVSdfV2sR+X3cEF/0o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)