UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OZsP2jSmVpoCPvWvWMOwbw8nOceWGGdDRdAHc1ZtANc='
WHERE
key_id = '671f45eabfb6346dd6c7f89fafc5426eb389c3b1dfe630eca4b11c06ca827296'
AND (
token = 'OZsP2jSmVpoCPvWvWMOwbw8nOceWGGdDRdAHc1ZtANc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)