UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '53DoSQh6RyA+eOBhtSstFyzHmIM9aguq4CKc+hqpyQo='
WHERE
key_id = '978f6b74d976f3cdc6f72da88c255b6844b793f82c83efe158cc38acd850455b'
AND (
token = '53DoSQh6RyA+eOBhtSstFyzHmIM9aguq4CKc+hqpyQo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)