UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qpGCZmMAIJcPJPKre9qc3IopW4gAew6+THEaHsg06lU='
WHERE
key_id = '92e62585de80ad33ea22e2c3b9d565a718e06349f7a3e65137ebaf66a6f9660a'
AND (
token = 'qpGCZmMAIJcPJPKre9qc3IopW4gAew6+THEaHsg06lU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)