UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AC7cvx0xboGMx8/WxBXsi0uJWpi/aetxk/pR2iP/oVQ='
WHERE
key_id = 'f85e9f50ae532ef6924c55a51dc7cb4240debd6f9b0f20cbbbf1cc818b36e000'
AND (
token = 'AC7cvx0xboGMx8/WxBXsi0uJWpi/aetxk/pR2iP/oVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)