UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z9Th0fllBWYnqwSMTZkfsPYLK3VpE+b4Qg2pIZR5JH0='
WHERE
key_id = 'a8937bdba7c73a83f7459d2bfb59c32db10241884c16d0c82dabf14941cabdad'
AND (
token = 'z9Th0fllBWYnqwSMTZkfsPYLK3VpE+b4Qg2pIZR5JH0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)