UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MG6oH1sF4MzsSBgcL6wzzlPGMN9uZatY/+JCKGHJnHQ='
WHERE
key_id = '3460fd4c02d797e7efc774f762718d63e35a4d9428c62e993b5f716743f03ed5'
AND (
token = 'MG6oH1sF4MzsSBgcL6wzzlPGMN9uZatY/+JCKGHJnHQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)