UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bFfHRIpvSgXiPnrDIf9WDwr/iJNDjr+APQuhaP4ayL8='
WHERE
key_id = '456f6065afacab0b9b3e72382a6bcd35c546ec6b03f3ab33f2829e8ec21c2cfe'
AND (
token = 'bFfHRIpvSgXiPnrDIf9WDwr/iJNDjr+APQuhaP4ayL8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)