UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mAxL2S1IF2PBkZ60fNkCbWj70fXUCDJFyAwIoFUnS9U='
WHERE
key_id = '42ddc540efdf2c5ed3d58e753d965f620e4df10fed74ca6c0e065f46c6171b46'
AND (
token = 'mAxL2S1IF2PBkZ60fNkCbWj70fXUCDJFyAwIoFUnS9U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)