UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'O11IfAntCDM/0IQCDSVIWsDCgCrAg4kLk7f6e282AdM='
WHERE
key_id = '28f7fa76930815bfb3754612f1f1f5d0b55ffcb87fb6f23d429692a6d84f4778'
AND (
token = 'O11IfAntCDM/0IQCDSVIWsDCgCrAg4kLk7f6e282AdM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)