UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JlxL7oyWRJdWRv7ZkT+hJZObxs9N82NYtlFN5HY1U+k='
WHERE
key_id = '3407cc23b64db58445bb98cf727dcc9a66d0fd56dbba3e25fe7d3c237037477e'
AND (
token = 'JlxL7oyWRJdWRv7ZkT+hJZObxs9N82NYtlFN5HY1U+k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)