UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8hSEN2/yboWkf9PZ131Vdwwmc4WeIUtJAB/r+9kTTLM='
WHERE
key_id = '41b29888cecf6a23f9cb3f349d6450866ad6cbf67faa9934e15f50e7a76c1f22'
AND (
token = '8hSEN2/yboWkf9PZ131Vdwwmc4WeIUtJAB/r+9kTTLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)