UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PmiP9JvqcihVsox4SQJ/qH5jNJ9pSvOtMhdz23LQ9Cw='
WHERE
key_id = '7a9d26d969352a6bd2c9c00238cdc2b7157db5cbe907b18943bf4fc32e644206'
AND (
token = 'PmiP9JvqcihVsox4SQJ/qH5jNJ9pSvOtMhdz23LQ9Cw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)