UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kHGG/XSzKePN/weG3NUy5jGLPPMH1b88H6gHLKdZ/S0='
WHERE
key_id = 'd7090b473ffed52eea74b1ce5dfb2a5281d926a899e26edbaafd03308f7a9ee4'
AND (
token = 'kHGG/XSzKePN/weG3NUy5jGLPPMH1b88H6gHLKdZ/S0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)