UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0Ogy7gUfkLqkQe7Yn6IP/2CJia967mNt7ZDTUyVK9sQ='
WHERE
key_id = 'ec18357e5c5e432561b3e76c17f39468112c1af852614ea2fd18447b36ae4ce5'
AND (
token = '0Ogy7gUfkLqkQe7Yn6IP/2CJia967mNt7ZDTUyVK9sQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)