UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'khxzDFKHP+jxnLkiiaSGwVAbYdGpJd436LzPKEVo6Bk='
WHERE
key_id = 'd25c94e0ae615b9134c8819b7b5b0502a25b66eb733af583cdf63298607f0d69'
AND (
token = 'khxzDFKHP+jxnLkiiaSGwVAbYdGpJd436LzPKEVo6Bk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)