UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'byGwo3SW44tSzTSYUgmSEZ2ladzCAARz4Fqvmb+8LTk='
WHERE
key_id = '2e8e321a66f65a820f3b47b617415e2c80473ba667cde9da5528ef33c1a86f07'
AND (
token = 'byGwo3SW44tSzTSYUgmSEZ2ladzCAARz4Fqvmb+8LTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)