UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZugUJe1UX4ly9bA7BAUVOkKTtv/QgU1ED75ImfEEtvo='
WHERE
key_id = '27477569e61e136adfa24d00ac3536f72d8d6dffbfaaaa5965bcf9b9624bc0b7'
AND (
token = 'ZugUJe1UX4ly9bA7BAUVOkKTtv/QgU1ED75ImfEEtvo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)