UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AU0DyHGBAJzWKpxlzO1rRziBfJ3nDqu1ApCpwLrTi5o='
WHERE
key_id = '4b33152bc2b77ec592926593d4bf2ccaead6df76c61e7cf2b567a77de9b36cb9'
AND (
token = 'AU0DyHGBAJzWKpxlzO1rRziBfJ3nDqu1ApCpwLrTi5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)