UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7f4Bhk1v43iI47bxcdeids366SbzeN8RcpCS/BauElY='
WHERE
key_id = '3607c346f52c7fea8d555fb7580c1e70ba7537184752db1f26622e9a930a0a68'
AND (
token = '7f4Bhk1v43iI47bxcdeids366SbzeN8RcpCS/BauElY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)