UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tcAGLJUY030iGUlsYO7o86qNGO9V+HnCGtHVO19bMJE='
WHERE
key_id = '8fa431e3199e40c8dfa027ac01cbe11dc2be9ed399e54979254db9e86b19d5e3'
AND (
token = 'tcAGLJUY030iGUlsYO7o86qNGO9V+HnCGtHVO19bMJE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)