UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ptsZ2Wrl8mLMx3YOQp7EXldmpv5tUzHhWyOnMJ/9W6Y='
WHERE
key_id = '6b12aedc5e9e5fbb91e961d4288bf4a32ae4e00f7a927d26ba76ee9b2c84e95c'
AND (
token = 'ptsZ2Wrl8mLMx3YOQp7EXldmpv5tUzHhWyOnMJ/9W6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)