UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hL1SQ4ggg1ebLUCt7ln+QGLXQFzzOrD9GP7JMmMO+jI='
WHERE
key_id = '2b9f321aa271e985ca6e2f31175986a52b237e23a05d037610a8e75df00d4ab0'
AND (
token = 'hL1SQ4ggg1ebLUCt7ln+QGLXQFzzOrD9GP7JMmMO+jI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)